import 'package:flutter/cupertino.dart';
import 'package:flutter_svg/svg.dart';
import 'package:health/constant/assets.dart';

class ToolsUtils {

  ToolsUtils._();

  static SvgPicture getAssetImageSvg(
      String assetName, {
        BoxFit fit = BoxFit.cover,
        double? width,
        double? height,
      }) {
    if (!assetName.endsWith('.svg')) {
      assetName = '$assetName.svg';
    }
    return SvgPicture.asset(
      '${Assets.svgUrl}/$assetName',
      width: width,
      height: height,
      fit: fit,
    );
  }

  static SvgPicture getUrlSvg(String url,
      {double? width, double? height, BoxFit fit = BoxFit.contain}) {
    return SvgPicture.network(url, width: width, height: height, fit: fit);
  }
}